src: use unique_ptr for scheduled delayed tasks#17083
Closed
fhinkel wants to merge 1 commit intonodejs:masterfrom
Closed
src: use unique_ptr for scheduled delayed tasks#17083fhinkel wants to merge 1 commit intonodejs:masterfrom
fhinkel wants to merge 1 commit intonodejs:masterfrom
Conversation
addaleax
reviewed
Nov 16, 2017
src/node_platform.cc
Outdated
Member
There was a problem hiding this comment.
Does the linter complain if you align arguments vertically?
src/node_platform.h
Outdated
Member
There was a problem hiding this comment.
Can you call this DelayedTaskPointer or something like that? Just to make clear it’s still a pointer and it’s not a conceptually different kind of thing
Use std::unique_ptr for delayed tasks in the scheduled delayed tasks vector. This makes it clear that the vector has ownership of the delayed tasks and is responsible for deleting them. Use a custom deleter for the pointers because libuv needs to close the handle and then delete the data. Provide the handle when creating the pointer instead of invoking the special delete action everytime an element is removed from the vector.
a7cc724 to
8fe4791
Compare
addaleax
approved these changes
Nov 17, 2017
Member
Author
|
Landed in 24e824a. |
fhinkel
added a commit
that referenced
this pull request
Nov 19, 2017
Use std::unique_ptr for delayed tasks in the scheduled delayed tasks vector. This makes it clear that the vector has ownership of the delayed tasks and is responsible for deleting them. Use a custom deleter for the pointers because libuv needs to close the handle and then delete the data. Provide the handle when creating the pointer instead of invoking the special delete action everytime an element is removed from the vector. PR-URL: #17083 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Member
|
@fhinkel Looks like this is the commit that is actually breaking CI :( |
addaleax
added a commit
to addaleax/node
that referenced
this pull request
Nov 19, 2017
2 tasks
MylesBorins
pushed a commit
that referenced
this pull request
Dec 12, 2017
Use std::unique_ptr for delayed tasks in the scheduled delayed tasks vector. This makes it clear that the vector has ownership of the delayed tasks and is responsible for deleting them. Use a custom deleter for the pointers because libuv needs to close the handle and then delete the data. Provide the handle when creating the pointer instead of invoking the special delete action everytime an element is removed from the vector. PR-URL: #17083 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
Member
Contributor
|
The files changed in this PR do not exist on v6.x Please feel free to change label if it can be manually backported |
Contributor
|
ping @fhinkel re: backport |
addaleax
pushed a commit
to addaleax/node
that referenced
this pull request
May 22, 2018
Use std::unique_ptr for delayed tasks in the scheduled delayed tasks vector. This makes it clear that the vector has ownership of the delayed tasks and is responsible for deleting them. Use a custom deleter for the pointers because libuv needs to close the handle and then delete the data. Provide the handle when creating the pointer instead of invoking the special delete action everytime an element is removed from the vector. PR-URL: nodejs#17083 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Member
|
Included a backport in #20901 |
MylesBorins
pushed a commit
that referenced
this pull request
Jun 14, 2018
Use std::unique_ptr for delayed tasks in the scheduled delayed tasks vector. This makes it clear that the vector has ownership of the delayed tasks and is responsible for deleting them. Use a custom deleter for the pointers because libuv needs to close the handle and then delete the data. Provide the handle when creating the pointer instead of invoking the special delete action everytime an element is removed from the vector. Backport-PR-URL: #20901 PR-URL: #17083 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
rvagg
pushed a commit
that referenced
this pull request
Aug 16, 2018
Use std::unique_ptr for delayed tasks in the scheduled delayed tasks vector. This makes it clear that the vector has ownership of the delayed tasks and is responsible for deleting them. Use a custom deleter for the pointers because libuv needs to close the handle and then delete the data. Provide the handle when creating the pointer instead of invoking the special delete action everytime an element is removed from the vector. Backport-PR-URL: #20901 PR-URL: #17083 Reviewed-By: Anna Henningsen <anna@addaleax.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.
Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
src